<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //arr.sort()从小到达排列，只针对10以内数字
    //若需要更大范围的判断就需要定义函数
    //arr.reverse() 对数组进行反序处理
    var arr = [3,2,5,1,9,20];
    var arr1 ;
    console.log(arr1);    
    arr1 = arr.sort(function(a,b){
        return a-b;
    })
    console.log(arr1);
</script>
</html>